﻿using Newtonsoft.Json.Linq;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;

namespace ADSTS_SERVER.Models
{
    /// <summary>
    /// 工程表
    /// </summary>
    [SugarTable("project", TableDescription = "工程表")]
    public class Project
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id", ColumnDescription = "主键ID")]
        public long Id { get; set; }

        /// <summary>
        /// 编号
        /// </summary>
        [SugarColumn(ColumnName = "serialno", ColumnDescription = "编号")]
        public string SerialNo { get; set; }

        /// <summary>
        /// 工程名称
        /// </summary>
        [SugarColumn(ColumnName = "name", ColumnDescription = "工程名称")]
        public string Name { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnName = "description", ColumnDescription = "描述")]
        public string Description { get; set; }

        /// <summary>
        /// 地图ID
        /// </summary>
        [SugarColumn(ColumnName = "mapid", ColumnDescription = "地图ID")]
        public long MapId { get; set; }

        /// <summary>
        /// 机器人ID
        /// </summary>
        [SugarColumn(ColumnName = "rbtid", ColumnDescription = "机器人ID")]
        public long RbtId { get; set; }

        /// <summary>
        /// 测试用例ID
        /// </summary>
        [SugarColumn(ColumnName = "tucid", ColumnDescription = "测试用例ID")]
        public long TUCId { get; set; }

        /// <summary>
        /// 集群ID
        /// </summary>
        [SugarColumn(ColumnName = "cluid", ColumnDescription = "集群ID")]
        public long CluId { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnName = "bridgeaddr", ColumnDescription = "描述")]
        public string BridegAddr { get; set; }

        /// <summary>
        /// 日期
        /// </summary>
        [SugarColumn(ColumnName = "pdate", ColumnDescription = "日期")]
        public string Pdate { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        [SugarColumn(ColumnName = "ptime", ColumnDescription = "时间")]
        public string Ptime { get; set; }

        /// <summary>
        /// 完整的日期时间
        /// </summary>
        [SugarColumn(ColumnName = "fulldatetime", ColumnDescription = "完整的日期时间")]
        public DateTime FullDateTime { get; set; }

        /// <summary>
        /// 任务参数
        /// </summary>
        [SugarColumn(ColumnName = "taskparams", ColumnDescription = "任务参数", ColumnDataType = "json", IsJson = true)]
        public Dictionary<string, string> TaskParams { get; set; }

        /// <summary>
        /// 雨
        /// </summary>
        [SugarColumn(ColumnName = "rainvalue", ColumnDescription = "雨")]
        public string RainValue { get; set; }

        /// <summary>
        /// 雾
        /// </summary>
        [SugarColumn(ColumnName = "fogvalue", ColumnDescription = "雾")]
        public string FogValue { get; set; }

        /// <summary>
        /// 湿度
        /// </summary>
        [SugarColumn(ColumnName = "humidityvalue", ColumnDescription = "湿度")]
        public string HumidityValue { get; set; }

        /// <summary>
        /// 云
        /// </summary>
        [SugarColumn(ColumnName = "cloudvalue", ColumnDescription = "云")]
        public string CloudValue { get; set; }

        /// <summary>
        /// 雪
        /// </summary>
        [SugarColumn(ColumnName = "snowvalue", ColumnDescription = "雪")]
        public string SnowValue { get; set; }

        /// <summary>
        /// 沙尘暴
        /// </summary>
        [SugarColumn(ColumnName = "sandstormvalue", ColumnDescription = "沙尘暴")]
        public string SandstormValue { get; set; }

        /// <summary>
        /// 植被生长速度
        /// </summary>
        [SugarColumn(ColumnName = "Vegetationgrowthvalue", ColumnDescription = "植被生长速度")]
        public string VegetationGrowthValue { get; set; }

        /// <summary>
        /// 道路破损程度
        /// </summary>
        [SugarColumn(ColumnName = "roaddamagevalue", ColumnDescription = "道路破损程度")]
        public string RoadDamageValue { get; set; }

        /// <summary>
        /// 仿真倍速
        /// </summary>
        [SugarColumn(ColumnName = "simulationxvalue", ColumnDescription = "仿真倍速")]
        public string SimulationXValue { get; set; }

        /// <summary>
        /// 测试报告 选中-1 未选中-0
        /// </summary>
        [SugarColumn(ColumnName = "testreport", ColumnDescription = "测试报告 选中-1 未选中-0")]
        public int TestReport { get; set; }

        /// <summary>
        /// 过程回放 选中-1 未选中-0
        /// </summary>
        [SugarColumn(ColumnName = "processplayback", ColumnDescription = "过程回放 选中-1 未选中-0")]
        public int ProcessPlayback { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        [SugarColumn(ColumnName = "uid", ColumnDescription = "用户ID")]
        public long UId { get; set; }

        /// <summary>
        /// 用户信息
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public User User { get; set; }

        /// <summary>
        /// 地图信息
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public MapModel MapModel { get; set; }

        /// <summary>
        /// 机器人信息
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public Robot Robot { get; set; }

        /// <summary>
        /// 集群信息
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public Cluster Cluster { get; set; }

        /// <summary>
        /// 测试用例
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public TestUseCase TestUseCase { get; set; }

        /// <summary>
        /// 测试结果
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<ProjectTestResult> ProjectTestResults { get; set; }

        /// <summary>
        /// 是否激活数据 1-是 0-否
        /// </summary>
        [SugarColumn(ColumnName = "isactive", ColumnDescription = "是否激活数据 1-是 0-否")]
        public int IsActive { get; set; } = 1;

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "created", IsOnlyIgnoreUpdate = true)]
        public DateTime Created { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>        
        [SugarColumn(ColumnName = "updated")]
        public DateTime Updated { get; set; } = DateTime.Now;
    }
}
